package com.test4;

import cn.hutool.core.date.DateUtil;
import com.alibaba.fastjson.JSONObject;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.time.DateFormatUtils;

import java.text.SimpleDateFormat;
import java.time.format.DateTimeFormatter;
import java.util.*;

public class Test2 {

    private static final String YYYY_MM_DD_HH_MM_SS =  "HH:mm";
    private static final DateTimeFormatter dateTimeFormatter = DateTimeFormatter.ofPattern(YYYY_MM_DD_HH_MM_SS);

    public static void main(String[] args) {

        Date now = new Date();
        String time = "11:40";
       System.err.println( test(time).after(now));


    }

    public static Date test(String time){


        // 获取当前日期
        Date currentDate = new Date();

        // 使用当前日期和指定时间来创建一个 Calendar 对象
        Calendar calendar = Calendar.getInstance();
        calendar.setTime(currentDate);

        // 解析时间字符串
        String[] timeParts = time.split(":");
        int hours = Integer.parseInt(timeParts[0]);
        int minutes = Integer.parseInt(timeParts[1]);

        // 设置 Calendar 对象的小时和分钟
        calendar.set(Calendar.HOUR_OF_DAY, hours);
        calendar.set(Calendar.MINUTE, minutes);

        // 获取日期和小时
        Date dateTime = calendar.getTime();
        return dateTime;
    }

}
